package com.mazaiting.common.core.ex.runtime;

import com.mazaiting.common.core.domain.result.Result;

/**
 * openfeign调用异常
 *
 * @author mazaiting
 * @create_time 2022/9/18 17:33
 */
public class FeignBizException extends RuntimeException {

    /**
     * 码值
     */
    private Integer code;

    public FeignBizException(Integer code, String message) {
        super(message);
        this.code = code;
    }

    public FeignBizException(Result<?> result) {
        this(result.getCode(), result.getMsg());
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }
}
